package com.nf.service;

import com.nf.dao.CategoryDao;
import com.nf.entity.Category;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {

    @Autowired
    private CategoryDao categoryDao;

    @Transactional
    public List<Category> getCategoryList() {
        System.out.println("这个dao是什么鬼："+categoryDao);
        List<Category> categoryList = categoryDao.getCategoryList();
        //模拟一个业务逻辑
        Category c = new Category();
        c.setId(88);
        c.setName("南方");
        categoryList.add(c);

        return categoryList;
    }
}
